﻿//插件调用代码
$(function () {
    var data = [
            { id: 11, name: '北京', citys: [
                { id: 1101, name: '东城区' },
                { id: 1102, name: '西城区' },
                { id: 1108, name: '海淀区' },
                { id: 1105, name: '朝阳区' },
                { id: 1106, name: '丰台区' },
                { id: 1107, name: '石景山区' },
                { id: 1109, name: '门头沟区' },
                { id: 1111, name: '房山区' },
                { id: 1112, name: '通州区' },
                { id: 1113, name: '顺义区' },
                { id: 1114, name: '昌平区' },
                { id: 1115, name: '大兴区' },
                { id: 1116, name: '怀柔区' },
                { id: 1117, name: '平谷区' },
                { id: 1128, name: '密云县' },
                { id: 1129, name: '延庆县' }
            ]
            },
            { id: 12, name: '天津', citys: [
                { id: 1201, name: '和平区' },
                { id: 1202, name: '河东区' },
                { id: 1203, name: '河西区' },
                { id: 1204, name: '南开区' },
                { id: 1205, name: '河北区' },
                { id: 1206, name: '红桥区' },
                { id: 1207, name: '塘沽区' },
                { id: 1208, name: '汉沽区' },
                { id: 1209, name: '大港区' },
                { id: 1210, name: '东丽区' },
                { id: 1211, name: '西青区' },
                { id: 1212, name: '津南区' },
                { id: 1213, name: '北辰区' },
                { id: 1214, name: '武清区' },
                { id: 1215, name: '宝坻区' },
                { id: 1221, name: '宁河县' },
                { id: 1223, name: '静海县' },
                { id: 1225, name: '蓟县' }
            ]
            },
            { id: 13, name: '河北', citys: [
                { id: 1301, name: '石家庄' },
                { id: 1302, name: '唐山' },
                { id: 1303, name: '秦皇岛' },
                { id: 1304, name: '邯郸' },
                { id: 1305, name: '邢台' },
                { id: 1306, name: '保定' },
                { id: 1307, name: '张家口' },
                { id: 1308, name: '承德' },
                { id: 1309, name: '沧州' },
                { id: 1310, name: '廊坊' },
                { id: 1311, name: '衡水' }
            ]
            },
            { id: 14, name: '山西', citys: [
                { id: 1401, name: '太原' },
                { id: 1402, name: '大同' },
                { id: 1403, name: '阳泉' },
                { id: 1404, name: '长治' },
                { id: 1405, name: '晋城' },
                { id: 1406, name: '朔州' },
                { id: 1407, name: '晋中' },
                { id: 1408, name: '运城' },
                { id: 1409, name: '忻州' },
                { id: 1410, name: '临汾' },
                { id: 1423, name: '吕梁' }
            ]
            },
            { id: 15, name: '内蒙古', citys: [
                { id: 1501, name: '呼和浩特' },
                { id: 1502, name: '包头' },
                { id: 1503, name: '乌海' },
                { id: 1504, name: '赤峰' },
                { id: 1505, name: '通辽' },
                { id: 1506, name: '鄂尔多斯' },
                { id: 1507, name: '呼伦贝尔' },
                { id: 1522, name: '兴安盟' },
                { id: 1525, name: '锡林郭勒盟' },
                { id: 1526, name: '乌兰察布盟' },
                { id: 1528, name: '巴彦淖尔盟' },
                { id: 1529, name: '阿拉善盟' }
            ]
            },
            { id: 21, name: '辽宁', citys: [
                { id: 2101, name: '沈阳' },
                { id: 2102, name: '大连' },
                { id: 2103, name: '鞍山' },
                { id: 2104, name: '抚顺' },
                { id: 2105, name: '本溪' },
                { id: 2106, name: '丹东' },
                { id: 2107, name: '锦州' },
                { id: 2108, name: '营口' },
                { id: 2109, name: '阜新' },
                { id: 2110, name: '辽阳' },
                { id: 2111, name: '盘锦' },
                { id: 2112, name: '铁岭' },
                { id: 2113, name: '朝阳' },
                { id: 2114, name: '葫芦岛' }
            ]
            },
            { id: 22, name: '吉林', citys: [
                { id: 2201, name: '长春' },
                { id: 2202, name: '吉林' },
                { id: 2203, name: '四平' },
                { id: 2204, name: '辽源' },
                { id: 2205, name: '通化' },
                { id: 2206, name: '白山' },
                { id: 2207, name: '松原' },
                { id: 2208, name: '白城' },
                { id: 2224, name: '延边朝鲜族自治州' }
            ]
            },
            { id: 23, name: '黑龙江', citys: [
                { id: 2301, name: '哈尔滨' },
                { id: 2302, name: '齐齐哈尔' },
                { id: 2303, name: '鸡西' },
                { id: 2304, name: '鹤岗' },
                { id: 2305, name: '双鸭山' },
                { id: 2306, name: '大庆' },
                { id: 2307, name: '伊春' },
                { id: 2308, name: '佳木斯' },
                { id: 2309, name: '七台河' },
                { id: 2310, name: '牡丹江' },
                { id: 2311, name: '黑河' },
                { id: 2312, name: '绥化' },
                { id: 2327, name: '大兴安岭' }
            ]
            },
            { id: 31, name: '上海', citys: [
                { id: 3101, name: '黄浦区' },
                { id: 3103, name: '卢湾区' },
                { id: 3104, name: '徐汇区' },
                { id: 3105, name: '长宁区' },
                { id: 3106, name: '静安区' },
                { id: 3107, name: '普陀区' },
                { id: 3108, name: '闸北区' },
                { id: 3109, name: '虹口区' },
                { id: 3110, name: '杨浦区' },
                { id: 3112, name: '闵行区' },
                { id: 3113, name: '宝山区' },
                { id: 3114, name: '嘉定区' },
                { id: 3115, name: '浦东新区' },
                { id: 3116, name: '金山区' },
                { id: 3117, name: '松江区' },
                { id: 3118, name: '青浦区' },
                { id: 3119, name: '南汇区' },
                { id: 3120, name: '奉贤区' },
                { id: 3130, name: '崇明县' }
            ]
            },
            { id: 32, name: '江苏', citys: [
                { id: 3201, name: '南京' },
                { id: 3202, name: '无锡' },
                { id: 3203, name: '徐州' },
                { id: 3204, name: '常州' },
                { id: 3205, name: '苏州' },
                { id: 3206, name: '南通' },
                { id: 3207, name: '连云港' },
                { id: 3208, name: '淮安' },
                { id: 3209, name: '盐城' },
                { id: 3210, name: '扬州' },
                { id: 3211, name: '镇江' },
                { id: 3212, name: '泰州' },
                { id: 3213, name: '宿迁' }
            ]
            },
            { id: 33, name: '浙江', citys: [
                { id: 3301, name: '杭州' },
                { id: 3302, name: '宁波' },
                { id: 3303, name: '温州' },
                { id: 3304, name: '嘉兴' },
                { id: 3305, name: '湖州' },
                { id: 3306, name: '绍兴' },
                { id: 3307, name: '金华' },
                { id: 3308, name: '衢州' },
                { id: 3309, name: '舟山' },
                { id: 3310, name: '台州' },
                { id: 3311, name: '丽水' }
            ]
            },
            { id: 34, name: '安徽', citys: [
                { id: 3401, name: '合肥' },
                { id: 3402, name: '芜湖' },
                { id: 3403, name: '蚌埠' },
                { id: 3404, name: '淮南' },
                { id: 3405, name: '马鞍山' },
                { id: 3406, name: '淮北' },
                { id: 3407, name: '铜陵' },
                { id: 3408, name: '安庆' },
                { id: 3410, name: '黄山' },
                { id: 3411, name: '滁州' },
                { id: 3412, name: '阜阳' },
                { id: 3413, name: '宿州' },
                { id: 3414, name: '巢湖' },
                { id: 3415, name: '六安' },
                { id: 3416, name: '亳州' },
                { id: 3417, name: '池州' },
                { id: 3418, name: '宣城' }
            ]
            },
            { id: 35, name: '福建', citys: [
                { id: 3501, name: '福州' },
                { id: 3502, name: '厦门' },
                { id: 3503, name: '莆田' },
                { id: 3504, name: '三明' },
                { id: 3505, name: '泉州' },
                { id: 3506, name: '漳州' },
                { id: 3507, name: '南平' },
                { id: 3508, name: '龙岩' },
                { id: 3509, name: '宁德' }
            ]
            },
            { id: 36, name: '江西', citys: [
                { id: 3601, name: '南昌' },
                { id: 3602, name: '景德镇' },
                { id: 3603, name: '萍乡' },
                { id: 3604, name: '九江' },
                { id: 3605, name: '新余' },
                { id: 3606, name: '鹰潭' },
                { id: 3607, name: '赣州' },
                { id: 3608, name: '吉安' },
                { id: 3609, name: '宜春' },
                { id: 3610, name: '抚州' },
                { id: 3611, name: '上饶' }
            ]
            },
            { id: 37, name: '山东', citys: [
                { id: 3701, name: '济南' },
                { id: 3702, name: '青岛' },
                { id: 3703, name: '淄博' },
                { id: 3704, name: '枣庄' },
                { id: 3705, name: '东营' },
                { id: 3706, name: '烟台' },
                { id: 3707, name: '潍坊' },
                { id: 3708, name: '济宁' },
                { id: 3709, name: '泰安' },
                { id: 3710, name: '威海' },
                { id: 3711, name: '日照' },
                { id: 3712, name: '莱芜' },
                { id: 3713, name: '临沂' },
                { id: 3714, name: '德州' },
                { id: 3715, name: '聊城' },
                { id: 3716, name: '滨州' },
                { id: 3717, name: '菏泽' }
            ]
            },
            { id: 41, name: '河南', citys: [
                { id: 4101, name: '郑州' },
                { id: 4102, name: '开封' },
                { id: 4103, name: '洛阳' },
                { id: 4104, name: '平顶山' },
                { id: 4105, name: '安阳' },
                { id: 4106, name: '鹤壁' },
                { id: 4107, name: '新乡' },
                { id: 4108, name: '焦作' },
                { id: 4109, name: '濮阳' },
                { id: 4110, name: '许昌' },
                { id: 4111, name: '漯河' },
                { id: 4112, name: '三门峡' },
                { id: 4113, name: '南阳' },
                { id: 4114, name: '商丘' },
                { id: 4115, name: '信阳' },
                { id: 4116, name: '周口' },
                { id: 4117, name: '驻马店' },
                { id: 4118, name: '济源' }
            ]
            },
            { id: 42, name: '湖北', citys: [
                { id: 4201, name: '武汉' },
                { id: 4202, name: '黄石' },
                { id: 4203, name: '十堰' },
                { id: 4205, name: '宜昌' },
                { id: 4206, name: '襄樊' },
                { id: 4207, name: '鄂州' },
                { id: 4208, name: '荆门' },
                { id: 4209, name: '孝感' },
                { id: 4210, name: '荆州' },
                { id: 4211, name: '黄冈' },
                { id: 4212, name: '咸宁' },
                { id: 4213, name: '随州' },
                { id: 4228, name: '恩施土家族苗族自治州' }
            ]
            },
            { id: 43, name: '湖南', citys: [
                { id: 4301, name: '长沙' },
                { id: 4302, name: '株洲' },
                { id: 4303, name: '湘潭' },
                { id: 4304, name: '衡阳' },
                { id: 4305, name: '邵阳' },
                { id: 4306, name: '岳阳' },
                { id: 4307, name: '常德' },
                { id: 4308, name: '张家界' },
                { id: 4309, name: '益阳' },
                { id: 4310, name: '郴州' },
                { id: 4311, name: '永州' },
                { id: 4312, name: '怀化' },
                { id: 4313, name: '娄底' },
                { id: 4331, name: '湘西土家族苗族自治州' }
            ]
            },
            { id: 44, name: '广东', citys: [
                { id: 4401, name: '广州' },
                { id: 4402, name: '韶关' },
                { id: 4403, name: '深圳' },
                { id: 4404, name: '珠海' },
                { id: 4405, name: '汕头' },
                { id: 4406, name: '佛山' },
                { id: 4407, name: '江门' },
                { id: 4408, name: '湛江' },
                { id: 4409, name: '茂名' },
                { id: 4412, name: '肇庆' },
                { id: 4413, name: '惠州' },
                { id: 4414, name: '梅州' },
                { id: 4415, name: '汕尾' },
                { id: 4416, name: '河源' },
                { id: 4417, name: '阳江' },
                { id: 4418, name: '清远' },
                { id: 4419, name: '东莞' },
                { id: 4420, name: '中山' },
                { id: 4451, name: '潮州' },
                { id: 4452, name: '揭阳' },
                { id: 4453, name: '云浮' }
            ]
            },
            { id: 45, name: '广西', citys: [
                { id: 4501, name: '南宁' },
                { id: 4502, name: '柳州' },
                { id: 4503, name: '桂林' },
                { id: 4504, name: '梧州' },
                { id: 4505, name: '北海' },
                { id: 4506, name: '防城港' },
                { id: 4507, name: '钦州' },
                { id: 4508, name: '贵港' },
                { id: 4509, name: '玉林' },
                { id: 4510, name: '百色' },
                { id: 4511, name: '贺州' },
                { id: 4512, name: '河池' },
                { id: 4521, name: '南宁' },
                { id: 4522, name: '柳州' }
            ]
            },
            { id: 46, name: '海南', citys: [
                { id: 4601, name: '海口' },
                { id: 4602, name: '三亚' },
                { id: 4690, name: '其他' }
            ]
            },
            { id: 50, name: '重庆', citys: [
                { id: 5001, name: '万州区' },
                { id: 5002, name: '涪陵区' },
                { id: 5003, name: '渝中区' },
                { id: 5004, name: '大渡口区' },
                { id: 5005, name: '江北区' },
                { id: 5006, name: '沙坪坝区' },
                { id: 5007, name: '九龙坡区' },
                { id: 5008, name: '南岸区' },
                { id: 5009, name: '北碚区' },
                { id: 5010, name: '万盛区' },
                { id: 5011, name: '双桥区' },
                { id: 5012, name: '渝北区' },
                { id: 5013, name: '巴南区' },
                { id: 5014, name: '黔江区' },
                { id: 5015, name: '长寿区' },
                { id: 5022, name: '綦江县' },
                { id: 5023, name: '潼南县' },
                { id: 5024, name: '铜梁县' },
                { id: 5025, name: '大足县' },
                { id: 5026, name: '荣昌县' },
                { id: 5027, name: '璧山县' },
                { id: 5028, name: '梁平县' },
                { id: 5029, name: '城口县' },
                { id: 5030, name: '丰都县' },
                { id: 5031, name: '垫江县' },
                { id: 5032, name: '武隆县' },
                { id: 5033, name: '忠县' },
                { id: 5034, name: '开县' },
                { id: 5035, name: '云阳县' },
                { id: 5036, name: '奉节县' },
                { id: 5037, name: '巫山县' },
                { id: 5038, name: '巫溪县' },
                { id: 5040, name: '石柱土家族自治县' },
                { id: 5041, name: '秀山土家族苗族自治县' },
                { id: 5042, name: '酉阳土家族苗族自治县' },
                { id: 5043, name: '彭水苗族土家族自治县' },
                { id: 5081, name: '江津市' },
                { id: 5082, name: '合川市' },
                { id: 5083, name: '永川区' },
                { id: 5084, name: '南川市' }
            ]
            },
            { id: 51, name: '四川', citys: [
                { id: 5101, name: '成都' },
                { id: 5103, name: '自贡' },
                { id: 5104, name: '攀枝花' },
                { id: 5105, name: '泸州' },
                { id: 5106, name: '德阳' },
                { id: 5107, name: '绵阳' },
                { id: 5108, name: '广元' },
                { id: 5109, name: '遂宁' },
                { id: 5110, name: '内江' },
                { id: 5111, name: '乐山' },
                { id: 5113, name: '南充' },
                { id: 5114, name: '眉山' },
                { id: 5115, name: '宜宾' },
                { id: 5116, name: '广安' },
                { id: 5117, name: '达州' },
                { id: 5118, name: '雅安' },
                { id: 5119, name: '巴中' },
                { id: 5120, name: '资阳' },
                { id: 5132, name: '阿坝' },
                { id: 5133, name: '甘孜' },
                { id: 5134, name: '凉山' }
            ]
            },
            { id: 52, name: '贵州', citys: [
                { id: 5201, name: '贵阳' },
                { id: 5202, name: '六盘水' },
                { id: 5203, name: '遵义' },
                { id: 5204, name: '安顺' },
                { id: 5222, name: '铜仁' },
                { id: 5223, name: '黔西南' },
                { id: 5224, name: '毕节' },
                { id: 5226, name: '黔东南' },
                { id: 5227, name: '黔南' }
            ]
            },
            { id: 53, name: '云南', citys: [
                { id: 5301, name: '昆明' },
                { id: 5303, name: '曲靖' },
                { id: 5304, name: '玉溪' },
                { id: 5305, name: '保山' },
                { id: 5306, name: '昭通' },
                { id: 5323, name: '楚雄' },
                { id: 5325, name: '红河' },
                { id: 5326, name: '文山' },
                { id: 5327, name: '思茅' },
                { id: 5328, name: '西双版纳' },
                { id: 5329, name: '大理' },
                { id: 5331, name: '德宏' },
                { id: 5332, name: '丽江' },
                { id: 5333, name: '怒江' },
                { id: 5334, name: '迪庆' },
                { id: 5335, name: '临沧' }
            ]
            },
            { id: 54, name: '西藏', citys: [
                { id: 5401, name: '拉萨' },
                { id: 5421, name: '昌都' },
                { id: 5422, name: '山南' },
                { id: 5423, name: '日喀则' },
                { id: 5424, name: '那曲' },
                { id: 5425, name: '阿里' },
                { id: 5426, name: '林芝' }
            ]
            },
            { id: 61, name: '陕西', citys: [
                { id: 6101, name: '西安' },
                { id: 6102, name: '铜川' },
                { id: 6103, name: '宝鸡' },
                { id: 6104, name: '咸阳' },
                { id: 6105, name: '渭南' },
                { id: 6106, name: '延安' },
                { id: 6107, name: '汉中' },
                { id: 6108, name: '榆林' },
                { id: 6109, name: '安康' },
                { id: 6110, name: '商洛' }
            ]
            },
            { id: 62, name: '甘肃', citys: [
                { id: 6201, name: '兰州' },
                { id: 6202, name: '嘉峪关' },
                { id: 6203, name: '金昌' },
                { id: 6204, name: '白银' },
                { id: 6205, name: '天水' },
                { id: 6206, name: '武威' },
                { id: 6207, name: '张掖' },
                { id: 6208, name: '平凉' },
                { id: 6209, name: '酒泉' },
                { id: 6210, name: '庆阳' },
                { id: 6224, name: '定西' },
                { id: 6226, name: '陇南' },
                { id: 6229, name: '临夏' },
                { id: 6230, name: '甘南' }
            ]
            },
            { id: 63, name: '青海', citys: [
                { id: 6301, name: '西宁' },
                { id: 6321, name: '海东' },
                { id: 6322, name: '海北' },
                { id: 6323, name: '黄南' },
                { id: 6325, name: '海南' },
                { id: 6326, name: '果洛' },
                { id: 6327, name: '玉树' },
                { id: 6328, name: '海西' }
            ]
            },
            { id: 64, name: '宁夏', citys: [
                { id: 6401, name: '银川' },
                { id: 6402, name: '石嘴山' },
                { id: 6403, name: '吴忠' },
                { id: 6404, name: '固原' }
            ]
            },
            { id: 65, name: '新疆', citys: [
                { id: 6501, name: '乌鲁木齐' },
                { id: 6502, name: '克拉玛依' },
                { id: 6521, name: '吐鲁番' },
                { id: 6522, name: '哈密' },
                { id: 6523, name: '昌吉' },
                { id: 6527, name: '博尔塔拉' },
                { id: 6528, name: '巴音郭楞' },
                { id: 6529, name: '阿克苏' },
                { id: 6530, name: '克孜勒苏' },
                { id: 6531, name: '喀什' },
                { id: 6532, name: '和田' },
                { id: 6540, name: '伊犁' },
                { id: 6542, name: '塔城' },
                { id: 6543, name: '阿勒泰' }
            ]
            },
            { id: 71, name: '台湾', citys: [
                { id: 7101, name: '台北' },
                { id: 7102, name: '高雄' },
                { id: 7190, name: '其他' }
            ]
            },
            { id: 81, name: '香港', citys: [
                { id: 8101, name: '香港' }
            ]
            },
            { id: 82, name: '澳门', citys: [
                { id: 8201, name: '澳门' }
            ]
            },
            { id: 100, name: '其他', citys: [
                { id: 10001, name: '其他' }
            ]
            },
            { id: 400, name: '海外', citys: [
                { id: 40001, name: '美国' },
                { id: 40002, name: '英国' },
                { id: 40003, name: '法国' },
                { id: 40004, name: '俄罗斯' },
                { id: 40005, name: '加拿大' },
                { id: 40006, name: '巴西' },
                { id: 40007, name: '澳大利亚' },
                { id: 40008, name: '印尼' },
                { id: 40009, name: '泰国' },
                { id: 40010, name: '马来西亚' },
                { id: 40011, name: '新加坡' },
                { id: 40012, name: '菲律宾' },
                { id: 40013, name: '越南' },
                { id: 40014, name: '印度' },
                { id: 40015, name: '日本' },
                { id: 40016, name: '其他' }
            ]
            }
        ];

    //选择
    $('#province, #city').citylist({ data: data, id: 'id', children: 'citys', name: 'name', metaTag: 'name' });

    //填充到制定文本框中

    $("#province").bind("change", function () {
        $("#Location").val($("#province").val() + " " + $("#city").val())
    });
    $("#city").bind("change", function () {
        $("#Location").val($("#province").val() + " " + $("#city").val())
    });

    window.prettyPrint && prettyPrint();



});